Skip to content

gh-125522: remove bare except usage in Lib/_pyio.py#138625

Closed
Lee-W wants to merge 2 commits into
python:mainfrom
Lee-W:gh-59518-get-rid-of-bare-except-for-_pyio
Closed

gh-125522: remove bare except usage in Lib/_pyio.py#138625
Lee-W wants to merge 2 commits into
python:mainfrom
Lee-W:gh-59518-get-rid-of-bare-except-for-_pyio

Conversation

@Lee-W

@Lee-W Lee-W commented Sep 7, 2025

Copy link
Copy Markdown

@bedevere-app

bedevere-app Bot commented Sep 7, 2025

Copy link
Copy Markdown

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

@Lee-W Lee-W changed the title refactor(Lib/_pyio): use explicit exception for open function gh-59518: get rid of bar except usage for Lib/_pyio.py Sep 7, 2025
@picnixz

picnixz commented Sep 7, 2025

Copy link
Copy Markdown
Member
  1. This is not related to IDLE.
  2. Those bare excepts seemcorrect as we're reraising the exceptions. I think we already took care of this in avoid bare except: in stdlib #125522

@picnixz picnixz added the pending The issue will be closed if no feedback is provided label Sep 7, 2025
@picnixz picnixz changed the title gh-59518: get rid of bar except usage for Lib/_pyio.py gh-125522: remove bare except usage in Lib/_pyio.py Sep 7, 2025
@Lee-W Lee-W closed this Sep 7, 2025
@Lee-W

Lee-W commented Sep 7, 2025

Copy link
Copy Markdown
Author

Got it. Thanks! I thought we were supposed to eliminate all these occurrences. Thanks for the reminder!

@Lee-W Lee-W deleted the gh-59518-get-rid-of-bare-except-for-_pyio branch September 7, 2025 16:35
@picnixz

picnixz commented Sep 7, 2025

Copy link
Copy Markdown
Member

No worries. There are some occurrences that need to be eliminated but others can be legitimate.

@Lee-W

Lee-W commented Sep 9, 2025

Copy link
Copy Markdown
Author

No worries. There are some occurrences that need to be eliminated but others can be legitimate.

btw, Should we try except Exception or except BaseException for this? If not, I will start looking into the IDLE ones. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pending The issue will be closed if no feedback is provided skip news

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants